import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

class Animal{
    public int a;
    public int b;
    public void fun(){
        System.out.println("111");
    }
    public Animal(int a ,int b){
        this.a = a;
        this.b = b;

    }
    public  Animal(int a){
        this.a=a;
    }

    public Animal(){

    }
}

public class Test04 {

    public static String multiply(String num1, String num2) {

        char[] arr1 = new StringBuilder(num1).reverse().toString().toCharArray();
        int m = arr1.length;
        char[] arr2 = new StringBuilder(num2).reverse().toString().toCharArray();
        int n = arr2.length;
        int[] acc = new int[m+n];

        for(int i =0;i<m;i++){
            for(int j = 0;j<n;j++){
                acc[i+j] += (arr1[i]-'0')*(arr2[j]-'0');
            }
        }
        StringBuilder str = new StringBuilder();

        int t = 0;
        for(int i = 0;i<acc.length;i++){
            str.append((acc[i]+t)%10);
            t = (acc[i]+t)/10;
        }
        for(int i = str.length()-1;i>=0;i--){
            if(str.charAt(i)!='0'){
                break;
            }else{
                str.deleteCharAt(i);
            }
        }
        return str.reverse().toString();
    }
    public static void main(String[] args) throws ClassNotFoundException, NoSuchFieldException, InstantiationException, IllegalAccessException, NoSuchMethodException {
        multiply("2","3");
        System.out.println(multiply("2","3"));
        System.out.println("111");
        ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

        Class<?> tmp1 = Class.forName("Animal");
       Field field = tmp1.getField("a");
        System.out.println(field);
      Object obj = tmp1.newInstance();
        field.set(obj,2);
        Animal animal = (Animal) obj;
        System.out.println(animal.a);

        Constructor[] constructors = tmp1.getConstructors();
        for(Constructor str:constructors){
            System.out.println(str);
        }
       Constructor constructor = tmp1.getConstructor();
        System.out.println(constructor);

        Method method = tmp1.getMethod("fun",null);
        System.out.println(method);
        int a = '8'-'0';
        System.out.println(a);
    }
}
